package com.smart.sso.server.MQ;

import com.alibaba.fastjson.JSON;
import com.smart.sso.server.dao.LoginlogDao;
import com.smart.sso.server.model.LoginlogEntity;
import com.smart.sso.server.model.UserEntity;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

@Component
//@RocketMQMessageListener(consumerGroup = "LAPTOP-T7NMFP8C", topic = "FinancialProject")
//implements RocketMQListener<String>
public class RocketMQReceiver  {

//    @Resource
//    private LoginlogDao loginlogDao;
//
//    @Override
//    public void onMessage(String msg) {
//        UserEntity userEntity = JSON.parseObject(msg, UserEntity.class);
//        LoginlogEntity loginlogEntity = new LoginlogEntity(0, userEntity.getUserId(), userEntity.getNickName(), new Date(), "用户" + userEntity.getNickName() + "于" + new Date() + "登录成功");
//        loginlogDao.insert(loginlogEntity);
//    }
}
